From e18bce2cf9c553751b08ad2979cb4216ea95b24e Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Sun, 1 Sep 2013 13:19:35 +0000 Subject: [PATCH] improve support for testo running from alternate directories. --- gpsbabel/testo | 4 ++-- gpsbabel/testo.d/text.test | 6 +++--- gpsbabel/testo.d/tpo.test | 4 ++-- gpsbabel/testo.d/unicsv.test | 4 ++-- gpsbabel/testo.d/xol.test | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/gpsbabel/testo b/gpsbabel/testo index 755d52b0a..faef2dad6 100755 --- a/gpsbabel/testo +++ b/gpsbabel/testo @@ -11,9 +11,9 @@ export MALLOC_CHECK_ LC_ALL=en_US.UTF-8 export LC_ALL -PNAME=${PNAME:-./gpsbabel} -DIFF=${DIFF:-diff} BASEPATH=`dirname $0` +PNAME=${PNAME:-${BASEPATH}/gpsbabel} +DIFF=${DIFF:-diff} REFERENCE=${BASEPATH}/reference # OD=${OD:-od -Ax -txC -v} if [ -x /usr/bin/hexdump ] ; then diff --git a/gpsbabel/testo.d/text.test b/gpsbabel/testo.d/text.test index a81ca86c8..0edef26c4 100644 --- a/gpsbabel/testo.d/text.test +++ b/gpsbabel/testo.d/text.test @@ -1,5 +1,5 @@ # Test HTML and Text output of a geocache. -gpsbabel -i gpx -f reference/gc/GCGCA8.gpx -o html -F ${TMPDIR}/gc.html -o text -F ${TMPDIR}/gc.txt -compare reference/gc/GCGCA8~text.txt ${TMPDIR}/gc.txt -compare reference/gc/GCGCA8~html.txt ${TMPDIR}/gc.html +gpsbabel -i gpx -f ${REFERENCE}/gc/GCGCA8.gpx -o html -F ${TMPDIR}/gc.html -o text -F ${TMPDIR}/gc.txt +compare ${REFERENCE}/gc/GCGCA8~text.txt ${TMPDIR}/gc.txt +compare ${REFERENCE}/gc/GCGCA8~html.txt ${TMPDIR}/gc.html diff --git a/gpsbabel/testo.d/tpo.test b/gpsbabel/testo.d/tpo.test index 3a774d1d5..b31701fe6 100644 --- a/gpsbabel/testo.d/tpo.test +++ b/gpsbabel/testo.d/tpo.test @@ -9,8 +9,8 @@ rm -f ${TMPDIR}/tpo-sample1.gpx ${TMPDIR}/tpo-sample2.tpo gpsbabel -t -i tpo2 -f ${REFERENCE}/track/tpo-sample1.tpo -o gpx -F ${TMPDIR}/tpo-sample1.gpx compare ${REFERENCE}/track/tpo-sample1.gpx ${TMPDIR}/tpo-sample1.gpx -#gpsbabel -t -i gpx -f reference/track/tpo-sample2.gpx -o tpo2 -F ${TMPDIR}/tpo-sample2.tpo -#bincompare ${TMPDIR}/tpo-sample2.tpo reference/track/tpo-sample2.tpo +#gpsbabel -t -i gpx -f ${REFERENCE}/track/tpo-sample2.gpx -o tpo2 -F ${TMPDIR}/tpo-sample2.tpo +#bincompare ${TMPDIR}/tpo-sample2.tpo ${REFERENCE}/track/tpo-sample2.tpo # # Version 3.x tests. Remove the timestamp from the generated file # so that the compare will succeed. diff --git a/gpsbabel/testo.d/unicsv.test b/gpsbabel/testo.d/unicsv.test index 27232adcb..0e17f66a5 100644 --- a/gpsbabel/testo.d/unicsv.test +++ b/gpsbabel/testo.d/unicsv.test @@ -11,6 +11,6 @@ compare ${REFERENCE}/unicsv.gpx ${TMPDIR}/unicsv.gpx gpsbabel -i garmin_txt -f ${REFERENCE}/garmin_txt.txt -x nuketypes,routes,tracks -o unicsv -F ${TMPDIR}/garmin_txt-uni.csv compare ${REFERENCE}/garmin_txt-uni.csv ${TMPDIR}/garmin_txt-uni.csv -gpsbabel -i gpx -f reference/gc/GC7FA4.gpx -o unicsv,utc=0 -F ${TMPDIR}/gcunicsv-1.csv -gpsbabel -i unicsv,utc=0 -f reference/gc/GC7FA4~unicsv.csv -o unicsv,utc=0 -F ${TMPDIR}/gcunicsv-2.csv +gpsbabel -i gpx -f ${REFERENCE}/gc/GC7FA4.gpx -o unicsv,utc=0 -F ${TMPDIR}/gcunicsv-1.csv +gpsbabel -i unicsv,utc=0 -f ${REFERENCE}/gc/GC7FA4~unicsv.csv -o unicsv,utc=0 -F ${TMPDIR}/gcunicsv-2.csv compare ${TMPDIR}/gcunicsv-1.csv ${TMPDIR}/gcunicsv-2.csv diff --git a/gpsbabel/testo.d/xol.test b/gpsbabel/testo.d/xol.test index d63f16cd5..b57aee7d4 100644 --- a/gpsbabel/testo.d/xol.test +++ b/gpsbabel/testo.d/xol.test @@ -16,6 +16,8 @@ ${PNAME} -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.g echo "${PNAME} succeeded! (it shouldn't have with this input...)" } # check error message is what we expected +# Note that the reference file nonexistent.err includes the file path, +# so this will fail when starting from a directory other than gpsbabel. compare ${REFERENCE}/nonexistent.err ${TMPDIR}/nonexistent.err -- 2.30.2